package com.tencent.welink.api.space.alarm;

import com.tencent.welink.api.OpenApiTokenChange;
import com.tencent.welink.api.base.WelinkOpenApi;
import com.tencent.welink.config.BussinessConfig;
import com.tencent.welink.util.CrontabUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

/**
 * @Description: 2.处理告警记录
 * @Author: limye
 * @CreateDate: 2020-6-15
 * @Version: V1.0
 */
public class ChangeStatus extends WelinkOpenApi {

    private static final Logger log = LogManager.getLogger(ChangeStatus.class);

    public ChangeStatus(){
        super("/space/datahub/alarm/v0.1/changeStatus",false);
    }


    @Override
    public void displayResult(String result) {
    }


    public static void main(String[] args) {
        new BussinessConfig();
        CrontabUtil.addTaskInRate(new OpenApiTokenChange(), BussinessConfig.loginDurationMinutes,true);

        //实例化对象
        ChangeStatus instance = new ChangeStatus();

        /**
         * 参数名	参数类型	说明	是否必填
         * uuid	String	告警的uuid，返回的列表中的id	是
         * status	String	告警状态 processed unprocessed processing	是
         * processor	String	告警处理人，可以为JSON字符串	是
         * processTime	Long	告警处理时间	是
         * advice	String	告警处理建议	否
         * processDescription	String	告警处理的描述信息	否
         * processExtend	String	告警处理的扩展信息，可以为JSON字符串	否
         * token	String	鉴权
         */
        //添加参数
        Map<String,Object> map = instance.getExtendsPara();
        map.put("uuid","ddkkbb");
        map.put("status","processed");
        map.put("processor","haiboliu");
        map.put("processTime",System.currentTimeMillis());

        //执行HTTP请求及展示结果
        instance.DoHttp();
        CrontabUtil.shutdown();

    }
}
